<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@page import="com.mew.util.*" %>
<%@page import="com.humyu.school.corebase.*" %>
<% request.setCharacterEncoding("UTF-8");%>
<html>
<head>
<title></title>
<script language="JavaScript">
function delete_confirm(){
 if(confirm("删除后将不能恢复，您确认执行删除操作么？")==true){
	return true;
 }
 return false;
}
</script>
<script language="javascript">
	function save(){
		document.execCommand('saveas','','report.htm');
	}
</script>
<link href="css/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center"><strong>学生刷卡查询</strong></p>
  <table width="100%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BBD1FC">
    <tr align="center">
      <td width="10%">日期</td>
      <td width="10%">班级</td>
      <td width="8%">学生</td>
      <td width="8%">上午到校</td>
      <td width="8%">上午迟到</td>
      <td width="8%">上午早退</td>
      <td width="8%">上午离校</td>
      <td width="8%">下午到校</td>
      <td width="8%">下午迟到</td>
      <td width="8%">下午早退</td>
      <td width="8%">下午离校</td>
      <td width="8%">其他</td>
    </tr>
	<%
		Iterator dairlyHis = (Iterator)request.getAttribute("dairlyHis");
		Iterator dairlyNow = (Iterator)request.getAttribute("dairlyNow");
		DairlyRecord dr = null;
		Student student = null;
		Grade grade = null;
		com.humyu.school.corebase.Class c = null;
		if(dairlyNow!=null){
			while(dairlyNow.hasNext()){//今天的
				dr = (DairlyRecord)dairlyNow.next();
				out.println("<tr align='center'>");
				//System.out.println("ok");
				//System.out.println(dr.toString());
				out.println("<td>&nbsp;"+dr.getDay()+"</td>");
				student = com.humyu.school.CoreFactory.getInstanceStudentManager().getStudentBySID(dr.getID());
				c = com.humyu.school.CoreFactory.getInstanceSchoolManager().getClass(dr.getSchoolID(),student.getClassID());
				grade = com.humyu.school.CoreFactory.getInstanceSchoolManager().getGrade(dr.getSchoolID(),c.getSchoolGradeID());
				out.println("<td>&nbsp;"+c.getSchoolClassName()+"</td>");
				out.println("<td>&nbsp;"+student.getName()+"</td>");
				out.println("<td>&nbsp;"+dr.get1CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get2CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get3CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get4CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get5CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get6CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get7CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get8CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.getCheckTimeStr()+"</td>");
				out.println("</tr>");
			}
		}
		if(dairlyHis!=null){
			while(dairlyHis.hasNext()){//历史的
				dr = (DairlyRecord)dairlyHis.next();
				out.println("<tr align='center'>");
				out.println("<td>&nbsp;"+dr.getDay()+"</td>");
				student = com.humyu.school.CoreFactory.getInstanceStudentManager().getStudentBySID(dr.getID());
				c = com.humyu.school.CoreFactory.getInstanceSchoolManager().getClass(dr.getSchoolID(),student.getClassID());
				grade = com.humyu.school.CoreFactory.getInstanceSchoolManager().getGrade(dr.getSchoolID(),c.getSchoolGradeID());
				out.println("<td>&nbsp;"+c.getSchoolClassName()+"</td>");
				out.println("<td>&nbsp;"+student.getName()+"</td>");
				out.println("<td>&nbsp;"+dr.get1CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get2CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get3CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get4CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get5CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get6CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get7CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.get8CheckTimeStr()+"</td>");
				out.println("<td>&nbsp;"+dr.getCheckTimeStr()+"</td>");
				out.println("</tr>");
			}
		}
	%>
</table>
<p align="center"> 
  <input type="button" name="Submit" value="返　回" onClick="history.back();">&nbsp;&nbsp;&nbsp;&nbsp; 
  <input type="button" name="Submit" value="打　印" onClick="print();">&nbsp;&nbsp;&nbsp;&nbsp; 
  <input type="button" name="Submit" value="下　载" onClick="save();">
  &nbsp;&nbsp;&nbsp;&nbsp; 
  <input type="button" name="Button" value="刷　新" onClick="history.go(0)">
</p>
</body>
</html>
